<div class="admin">
<div class="tab panel dux-box admin-panel">
    <div class="panel-head"><strong>商品列表</strong></div>
    <div class="padding border-bottom">
        <a href="JavaScript:void(0);" class="button button-small border-green">管理</a>
    </div>
    <div class="fixed-empty"></div>
    <form method="post" action="{:U('index')}" name="formSearch" id="formSearch">
        <table class="tb-type1 noborder search">
            <tbody>
            <tr>
                <th><label>入驻商家名称</label></th>
                <td><input class="input input_big" type="text" name="user_name" value=""></td>
                <td><input  class="button bg-main" type="submit" value="查询" /></td>
            </tr>
            </tbody>
        </table>
    </form>
    <form name="myform" id="myform" action="" method="post">
    <table class="table tb-type2 nobdb">
        <thead>
        <tr class="thead">
            <th class="align-center">公司名称</th>
            <th class="align-center">公司地址</th>
            <th class="align-center">联系人</th>
            <th class="align-center">联系电话</th>
            <th class="align-center">经营产品</th>
            <th class="align-center">申请备注</th>
            <th class="align-center">是否联系</th>

        </tr>
        </thead>
        <tbody>
        <foreach item="v" name="list">
            <tr class="hover" style="background: rgb(255, 255, 255);">
                <td class="align-center">{$v['company_name']}</td>
                <td class="align-center">{$v['company_address_detail']}</td>
                <td class="align-center">{$v['contacts_name']}</td>
                <td class="align-center">{$v['contacts_phone']}</td>
                <td class="align-center">{$v['business_sphere']}</td>
                <td class="align-center">{$v['remarks']}</td>
                <if condition="($v['joinin_state'] eq 10)">
                    <td class="align-center" onclick="zt({$v['id']},$(this))"><span style="font-size: 24px;color: red">×</span></td>
                <else />
                    <td class="align-center" onclick="zt({$v['id']},$(this))"><span style="font-size: 24px;color:#00aa00">√</span></td>
                </if>

            </tr>
        </foreach>
        </tbody>
        <tfoot>
        <tr class="tfoot">
            <td colspan="15"><div class="pages clearfix">{$page}</div></td>
        </tr>
        </tfoot>
    </table>
    </form>
</div>
</div>
<script type="text/javascript">
    $('#myform').layer({
        actionUrl: "batchAction",
        deleteUrl: "{:U('delete')}"
    });

    function zt(id,obj)
    {
        switch(obj.text()){
            case '×':str = '<span style="font-size: 24px;color:#00aa00">√</span>';t = '标记为已受理状态?';break;
            case '√':str = '<span style="font-size: 24px;color: red">×</span>';t = '标记为未受理状态?';break;
        }
        layer.msg(
            t,
            {time: 60000,btn: ['是的','算了']},
            function(){
                data = {type:obj.text(),id:id};
                url = adminUrl+'/Audit/state';
                p = Aajax(url,data);
                if(p.p){
                    obj.find("span").remove();
                    $(str).appendTo(obj);
                    layer.msg('修改成功');
                }else{
                    layer.msg('失败请稍后重试');
                }
            },
			function(){}
        )
    }

</script>